package com.hugh.glrpcconsumer.service.impl;

import com.hugh.entity.ResumeEntity;
import com.hugh.glrpcconsumer.annotation.GlReference;
import com.hugh.glrpcconsumer.service.ApiUserService;
import com.hugh.service.ResumeService;
import com.hugh.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Hugh
 * @Date: 2020/6/14
 */
@Service
public class ApiUserServiceImpl implements ApiUserService {

    @GlReference
    private UserService userService;

    @GlReference
    private ResumeService resumeService;


    @Override
    public Object getUserInfo() {
        return userService.sayHello("this is a client message");
    }

    @Override
    public Object queryResumeList() {
        try {
            List<ResumeEntity> resumeEntities = resumeService.queryResumeList();
            return resumeEntities;
        }
        catch (Exception e){
            return null;
        }
    }
}
